Skip to content

fix: prevent schedule reset when scheduling config hasn't changed#829

Merged
chubes4 merged 1 commit intomainfrom
fix/scheduling-no-op-guard
Mar 17, 2026
Merged

fix: prevent schedule reset when scheduling config hasn't changed#829
chubes4 merged 1 commit intomainfrom
fix/scheduling-no-op-guard

Conversation

@chubes4
Copy link
Member

@chubes4 chubes4 commented Mar 17, 2026

Summary

  • handle_scheduling_update() unconditionally unscheduled and rescheduled flows even when the incoming config was identical to what was already set
  • This reset the Action Scheduler timer and set first_run to now(), triggering an immediate run
  • On Mar 16-17, this caused the agent ping flow (every_3_days) to fire 3 times in 7 hours instead of once every 3 days

Root cause

Any code path that calls UpdateFlowAbility with scheduling_config included — even with identical values — would:

  1. as_unschedule_all_actions() — kill the existing schedule
  2. as_schedule_recurring_action(time() + stagger, ...) — create a new one starting from now
  3. Update first_run in the DB to the new timestamp

There was no check to see if the schedule was already set to the requested interval.

Fix

Adds scheduling_unchanged() private method that compares the incoming scheduling fields against the current DB values:

  • Recurring: compares interval key (e.g. every_3_days)
  • Cron: compares cron_expression string
  • One-time: compares timestamp
  • Manual → manual: always a no-op

If nothing changed, handle_scheduling_update() returns true early without touching Action Scheduler.

Impact

  • Fixes spurious flow re-fires when flows are updated without changing their schedule
  • No impact on intentional schedule changes — those still unschedule/reschedule normally
  • No impact on flow creation — new flows have no current scheduling to compare against

handle_scheduling_update() unconditionally unscheduled and rescheduled
flows even when the incoming config was identical to what was already
set. This reset the Action Scheduler timer and triggered an immediate
run every time any flow update included scheduling_config.

Adds scheduling_unchanged() guard that compares incoming interval,
cron_expression, or timestamp against the current DB values and
returns early if nothing changed. Covers recurring, cron, one_time,
and manual scheduling types.
@chubes4 chubes4 merged commit a7bbe46 into main Mar 17, 2026
3 checks passed
@chubes4 chubes4 deleted the fix/scheduling-no-op-guard branch March 17, 2026 00:20
@github-actions
Copy link

github-actions bot commented Mar 17, 2026

Homeboy Results — data-machine

Lint

⚡ Scope: changed files only

lint (changed files only)

Test

⚡ Scope: changed files only

test (changed files only)

Audit

⚡ Scope: changed files only

audit (changed files only)

Tooling versions
  • Homeboy CLI: homeboy 0.78.0+6bfff7f4
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: unknown
  • Action: Extra-Chill/homeboy-action@v1

Homeboy Action v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant